Socket
Socket
Sign inDemoInstall

caccl-lti

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

caccl-lti

LTI launch validator for IMS-LTI standard launches.


Version published
Weekly downloads
46
increased by130%
Maintainers
1
Weekly downloads
 
Created
Source

caccl-lti

Validates and parses LTI launch requests.

With caccl-lti, it's easy to enable LTI launches from Canvas. We'll take care of parsing and verifying the validity of launch requests.

Part of the CACCL library

Canvas
App
Complete
Connection
Library

Quickstart

Quickstart:

const initLTI = require('caccl-lti');

initLTI({
  app: /* express app with express-sessions enabled */,
  installationCredentials: /* { consumer_key, consumer_secret }*/,
});

The app will now be set up to accept LTI launches at /launch. See "Launch Parsing" below to find info on parsed launches.

Configuration Options

When initializing caccl-lti, you can pass in many different configuration options to customize caccl-lti's behavior or turn on/off certain functionality.

Note: configuration options are optional unless otherwise stated

Config OptionTypeDescriptionDefault/Required
appexpress appexpress app to add routes toRequired
installationCredentialsobjectLTI consumer credentials of form: { consumer_key, consumer_secret }Required
launchPathstringpath to accept launches at (new express POST route added)/launch
redirectToAfterLaunchstringpath to redirect to after successful launchsame as launchPath
nonceStoreNonceStorea nonce store to use for keeping track of used noncesmemory store
disableAuthorizeOnLaunchbooleanif false, redirects to authorizePath after launch is validated and parsed (and includes redirectToAfterLaunch) as the 'next link so that caccl-authorizer redirects to redirectToAfterLaunch after finishing authorizationfalse
authorizePathstringthe authorization path (as set up by caccl-authorizer, required if disableAUthorizeOnLaunch is truenull

Launch Parsing

Launches are automatically parsed and added to session. To retrieve launch info, see the req.session.launchInfo variable, which has the following properties:

For more detailed information, see Canvas' LTI documentation.

User Info

PropertyTypeDescription
userIdnumberCanvas user id of the person who launched the app
userLoginIdstringCanvas login id (e.g., university id)
userEmailstringthe user's primary Canvas email (changeable in user's profile)
userFirstNamestringthe user's first name
userLastNamestringthe user's last name
userFullNamestringthe user's full name
userImagestringlink to user's image
isInstructorbooleantrue if the user is an instructor in the launch course
isTAbooleantrue if the user is a teaching assistant in the launch course
isDesignerbooleantrue if the user is a designer in the launch course
isCreditLearnerbooleantrue if the user is a for-credit learner (student) in the launch course
isNonCreditLearnerbooleantrue if the user is a not-for-credit learner (student) in the launch course
isLearnerbooleantrue if the user any type of learner (student) in the launch course
notInCoursebooleantrue if the user is not enrolled in the course
extRolesstring[]list of extended Canvas roles
rolesstring[]list of basic Canvas roles (outdated)
localestringuser locale (e.g., "en")
Launch Info
PropertyTypeDescription
timestampnumberlaunch timestamp (ms)
contextIdstringLTI launch context
launchPresentationTargetstringLTI launch presentation target (e.g., "iframe")
iframeWidthnumberiframe width (if applicable)
iframeHeightnumberiframe height (if applicable)
returnURLstringLTI return URL
launchAppTitlestringthe title of the resource link (app title)
customParamsobjectmapping (key => value) listing all custom launch parameters and their values
Course Info
PropertyTypeDescription
courseIdnumberCanvas course id of the launch course
sisCourseIdnumberLearning Information Services identifier for the course offering
enrollmentStatestringCanvas enrollment state (e.g., "active")
Canvas Info
PropertyTypeDescription
contextLabelstringthe name of the launch context (e.g., course name)
canvasHoststringhost of the launch Canvas instance
workflowStatestringCanvas workflow status (e.g., "active")

Keywords

FAQs

Package last updated on 13 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc